package com.zhuqieli.database_learn.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zhuqieli.database_learn.pojo.FileTable;
import com.zhuqieli.database_learn.enummeration.Result;

import java.net.URL;
import java.util.List;

public interface FileTableService extends IService<FileTable> {
    public void insertFileTable(FileTable fileTable);

    public void upDateFileTable(FileTable fileTable);


    //通过用户id查找文件
    List<FileTable> selectMyfiles(Integer userId);

    public void setFileDeleted(String snowflakeId);

    //批量设置文件已删除
    void setFileListDeleted(String snowflakeIds);

    //批量设置文件公开
    void setFileListPublic(String[] snowflakeIds);

    //查看本人已删除文件
    List<FileTable> selectUserRecycle(Integer userId);

    //还原删除文件
    void rollbackFileDeleted(String snowflakeId);

    //查看公开的所有文件
    List<FileTable> selectAllPublicFiles(int size, int current);

    public Result fileDownload(String account, String fileId);//用戶名name，雪花id

    public String fileSizeShow(String account, String fileId);

    public void fileDelete(String objectName);

    public void fileRename(String objectName, String newObjectName);

    void uploadFileTable(List<FileTable> fileInfosAndUploadToOSS, Integer userId, String username);

    URL downloadUrl(String username, String filename);

    URL preViewUrl(String username, String filename);
}
